package com.px.idal;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.px.model.AwardInfo;

public interface IAwardInfoMapper {
	/**
	 * 查询方法
	 * 查询所有奖项
	 * 使用@Select 注解指明getAllawards方法要执行的SQL
	 * */
	@Select("select * from awards_tb")
	public List<AwardInfo> getAllawards();

	/**
	 * Insert方法
	 * 增加奖项company_info_tb 
	 * 传参为对象方法
	 * */
	@Insert("insert into awards_tb(awards_name,review_id,project_class_id,prize_1,prize_2,prize_3,award_tip)value(#{awards_name},#{review_id},#{project_class_id},#{prize_1},#{prize_2},#{prize_3},#{award_tip})")
	public int insertAwards(AwardInfo awards);

	/**
	 * 更新方法
	 * 更新指定awards_id的奖项
	 * 示例
	 * */
	@Update("UPDATE awards_tb SET awards_name=#{awards_name},review_id=#{review_id},project_class_id=#{project_class_id},prize_1=#{prize_1},prize_2=#{prize_2},prize_3=#{prize_3},award_tip=#{award_tip} where awards_id=#{awards_id}")
	public int updateAdwardsByAdardsId(AwardInfo awards);
	

	/**
	 * 查询方法
	 * 查询指定awards_id的奖项
	 * 示例
	 * */
	@Select("select * from awards_tb where awards_id=#{awards_id}")
	public List<AwardInfo> selectAdwardsByAdardsId(AwardInfo awards);

	/**
	 * 删除方法
	 * 删除指定awards_id的奖项
	 * 示例
	 * */
	@Delete("delete from awards_tb where awards_id=#{awards_id}")
	public int deleteAdwardsByAdardsId(Integer awards_id);

	/**
	 * 查询用户信息总条数
	 *  
	 * */
	@Select("select count(*) from awards_tb")
	public int getAllAwardsCounts();

	/**
	 * 查询指定awards_id是否存在
	 * 
	 * */
	@Select("select count(*) from awards_tb where awards_id=#{awards_id}")
	public int checkAdwardsIdIsExist(AwardInfo awards);

}
